﻿using System;

namespace b2
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] arr = { 1,2,3,4,5,6};
            int max = arr[0];
            int min = arr[0];
            for(int i = 0;i<arr.Length;i++)
            {
                if (max < arr[i])
                    max = arr[i];
                if (min > arr[i]) 
                    min = arr[i];
            }
            Console.Write("该数组的最大值为");
            Console.WriteLine(max);
            Console.Write("该数组的最小值为");
            Console.WriteLine(min);

            double sum = 0;
            for (int i=0;i<arr.Length;i++)
            {
                sum += arr[i];
            }
            Console.WriteLine("该数组的总和为" + sum);
            Console.WriteLine("该数组的平均数为" + sum / arr.Length);

        }
    }
}
